<%--
  Created by IntelliJ IDEA.
  User: 东方九夜
  Date: 2021/6/12
  Time: 15:12
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<script type="text/javascript">
  function forget(){
    alert("请及时联系15028585993进行密码修改！");
  }

  function login() {

    var username = document.getElementById("username");
    var pass = document.getElementById("password");

    if (username.value === "") {
      alert("请输入用户名");
      return false;
    } else if (pass.value === "") {
      alert("请输入密码");
      return false;
    }
    return true;
  }
</script>

<html lang="en"><!--可删，lang="en"会让浏览器显示“”翻译此页-->

<head>
  <meta charset="UTF-8">
  <title>登录页面</title>
  <link rel="stylesheet" type="text/css" href="css/login.css"/>
</head>

<body>
<a href="https://kns.cnki.net/kns/brief/default_result.aspx" style="color: white"%> @中国知网 </a>
<a href="http://library.ysu.edu.cn/" style="color: white"> @燕山大学图书馆 </a>

<div id="login_main">
  <div id="logo_image" ><img src="image/YSUlogo.png" width="180" height="54"></div>
  <form method="post" action="LoginServlet"><!--method 该属性定义了如何发送数据，action 这个属性定义了发送数据要去的位置-->
    <p><label class="label_input" for="usernumber">用户名</label>
      <input type="text" id="usernumber" class="text_field" name="usernumber"/></p>
    <p><label class="label_input" for="password">密码</label>
      <input type="password" id="password" class="text_field" name="password"/></p>

    <div id="login_control">
      <input type="submit" id="btn_login" value="登录" onclick="return login()"/>
      <a id="forget" href="javascript:forget();"><i>忘记密码</i></a>
    </div>

    <div id="login_chosen">
      <input type="radio" name="shenfen" value="student" checked/>学生
      <input type="radio" name="shenfen" value="teacher"/>教师
      <input type="radio" name="shenfen" value="admin"/>管理员
    </div>
  </form>
</div>
</body>

</html>
